<template>
  <div>
    <div class="mv">
      <span
        class="iconfont icon-zuoyoujiantou"
        @click="$router.push('/userinfo')"
        >MV</span
      >
    </div>
    <div class="mvlist">
      <div class="mvlistbox" v-for="(item, index) in mvlist" :key="index" @click="$router.push({name:'mvplay',query:{id:item.id}})">
        <div class="mvimg" :style="'background-image: url(' + item.cover + ')'">
          <div class="mvbg">
            <span>{{ item.name }}</span>
            <p>{{ item.artistName }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getMvAll } from "../../api/base";
export default {
  data() {
    return {
      // mvlist:{

      // },
      mvlist:[],
    };
  },
  methods: {
    getMvAllFun() {
      getMvAll().then((data) => {
        console.log(data.data);
        this.mvlist = data.data;
      });
    },
  },
  created() {
    this.getMvAllFun();
  },
};
</script>

<style lang="less">
.mv {
  height: 50px;
  position: relative;
  background-color: #d4473c;
  span {
    font-size: 18px;
    position: absolute;
    left: 12px;
    top: 12px;
    color: #fff;
  }
}
.mvlist {
  margin-top: 10px;
  .mvlistbox {
    // width: 100%;
    height: 150px;
    border: 1px solid white;
    box-shadow: 1px 1px 5px 0px #888888;
    border-radius: 10px;
    margin: 15px 10px;

    
    .mvimg {
      width: 100%;
      height: 100%;
      background-size: cover;
      // background-repeat: no-repeat;
      border-radius: 10px;
      // z-index: -1;
      .mvbg {
        width: 100%;
        height: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        background-color: rgba(0, 0, 0, 0.45);
        border-radius: 10px;
        span {
          width: 200px;
          font-size: 23px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          word-wrap: normal;
          margin-left: 10px;
          color: white;
        }
        p {
          font-size: 15px;
          margin-left: 10px;
          color: white;
        }
      }
    }
  }
}
</style>